function [x] = random_walk(N,M)
% Random-Walk sample sequencess
% N = number of RVs in a Random-walk sequence
% M = number of Random-walks
%
Close all;

w = 2*randint(N,M)-1;
x = cumsum(w,1);

figure('units','normalized','position',[0.1,0.1,0.8,0.8]);
plot([1:N],x,[0,N],[0,0],'w:'); 
title('Random Walks','fontsize',18);
xlabel('n','fontsize',16); 
ylabel('Amplitude','fontsize',16);